//
//  YsSmartPenManager.h
//  YsSmartPenCoreModule
//
//  Created by Cer on 2020/4/20.
//

#import <Foundation/Foundation.h>
#import <SmartPenSDK/SmartPenSDK.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, YsSmartPenManagerConnectStatus) {
    YsSmartPenManagerConnectTimeoutStatus = 0,
    YsSmartPenManagerConnectSuccessStatus = 1,
    YsSmartPenManagerConnectFailStatus = 2
};
@protocol YsSmartPenManagerDelegate <NSObject>
+ (instancetype)shareManager;
@end
@interface YsSmartPenManager : NSObject <YsSmartPenManagerDelegate>

/// 搜索智能笔
/// @param seconds 搜索时间
/// @param scanResult 结果回调
- (void)searchSmartPenWithTimeInterval:(NSTimeInterval)seconds
                        withScanResult:(void(^)(CBPeripheral *_Nullable peripheral,NSDictionary * _Nullable advertisementData,NSNumber * _Nullable RSSI, BOOL isTimeOut))scanResult;

/// 停止搜索设备
- (void)stopFindDevices;
/// 通过Mac地址连接蓝牙
/// @param macAdress Mac地址
/// @param timeout 超时时间
/// @param connectResult 连接状态的回调
- (void)connectSmartPenWithMacAdress:(NSString *)macAdress
                         withTimeout:(NSTimeInterval)timeout withConnectResult:(void(^)(YsSmartPenManagerConnectStatus connectStatus))connectResult;

/// 通过蓝牙对象连接蓝牙
/// @param peripheral 蓝牙对象
/// @param timeout 超时时间
/// @param connectResult 连接状态的回调
- (void)connectSmartPenWithPeripheral:(CBPeripheral *)peripheral
                          withTimeout:(NSTimeInterval)timeout withConnectResult:(void(^)(YsSmartPenManagerConnectStatus connectStatus))connectResult;
@end

NS_ASSUME_NONNULL_END
